﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
using System.Security;
using System.Security.Principal;

namespace plvs
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //try
            //{
                //App Run As Admin
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //WindowsIdentity identity = WindowsIdentity.GetCurrent();
                //WindowsPrincipal principal = new WindowsPrincipal(identity);
                //if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
                //{
                //    MessageBox.Show("You must run this application as administrator. Terminating.");
                //    return;
                //}
                //// Run Program
                //int RuningProgram = 0;
                //Process[] p1 = new Process[Process.GetProcesses().Length];
                //p1 = Process.GetProcesses();
                //for (int i = 0; i < p1.Length; i++)
                //{
                //    if (p1[i].ProcessName.ToLower() == "plvs")
                //        RuningProgram++;
                //    if (RuningProgram > 1)
                //        return;
                //}
                Application.Run(new Form1());
            //}
            //catch (Exception ex)
            //{
            //    if (ex != null)
            //        MessageBox.Show(ex.Message);
            //}

        }
    }
}
